package com.softqin.washer.common;

import java.util.ArrayList;
import java.util.List;

import android.app.Activity;
import android.app.Application;
import android.content.Context;

/**
 * 
 * @ClassName: WasherApp
 * 
 * @Description:
 * 
 * @author
 * 
 * @date 2014-12-20
 */
public final class WasherApp extends Application {

    private final static String TAG = "WasherApp";
    private static WasherApp mcontext;

    private static WasherApp mInstance = null;

    public static int mIHomepageBottomId = 1;

    private List<Activity> listActivities;

    @Override
    public void onCreate() {
        super.onCreate();
        mInstance = this;
        listActivities = new ArrayList<Activity>();
        mcontext = this;
    }

    public static WasherApp getInstance() {
        return mInstance;
    }

    public static Context getAppContext() {
        return mcontext;
    }

    public void addActivity(Activity activity) {
        listActivities.add(activity);
    }

    public void finishAllActivity() {

        for (int i = 0; i < listActivities.size(); i++) {
            listActivities.get(i).finish();
        }
    }

}
